home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / gnu / oleo-1_4.lha / oleo-1.4 / graph.h < prev    next >
C/C++ Source or Header  |  1993-03-11  |  5KB  |  168 lines

  1. #ifndef GRAPHH
  2. #define GRAPHH
  3.  
  4. /*    Copyright (C) 1993 Free Software Foundation, Inc.
  5.  
  6. This program is free software; you can redistribute it and/or modify
  7. it under the terms of the GNU General Public License as published by
  8. the Free Software Foundation; either version 2, or (at your option)
  9. any later version.
  10.  
  11. This program is distributed in the hope that it will be useful,
  12. but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14. GNU General Public License for more details.
  15.  
  16. You should have received a copy of the GNU General Public License
  17. along with this software; see the file COPYING.  If not, write to
  18. the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
  19. /*  t. lord    Mon Mar  1 17:37:20 1993    */
  20.  
  21. #include "cell.h"
  22.  
  23. enum graph_axis
  24. {
  25.   graph_x = 0,
  26.   graph_y = 1,
  27.   graph_num_axis = 2
  28. };
  29. extern char * graph_axis_name [graph_num_axis];
  30.  
  31. /*
  32.  * These are named according to the outermost iterator.
  33.  * Thus graph_rows indicates that cells should be read in
  34.  * the loop:
  35.  *
  36.  *    for (r = lr; r <= hr; ++r)
  37.  *          for (c = lc; c <= hc; ++c)
  38.  *        ....
  39.  */
  40. enum graph_ordering
  41. {
  42.   graph_rows = 0,
  43.   graph_cols = 1,
  44.   graph_num_orders = 2
  45. };
  46. extern char * graph_order_name [graph_num_orders];
  47.  
  48. /* These describe supported ways to iterate over a range extracting
  49.  * pairs of cells.
  50.  *
  51.  * There are two degrees of freedom:  the 2 cells in each
  52.  * pair may be oriented horizontally or verically
  53.  *             ______________
  54.  *    horizontal     |   1  |  2  |
  55.  *             --------------
  56.  *
  57.  *
  58.  *             --------
  59.  *    vertical     |   1    |
  60.  *             --------
  61.  *               |   2  |
  62.  *             --------
  63.  *
  64.  *      or the first member of each pair may be implicitly supplied.
  65.  *    In that case, the values used will be 0, 1, 2 ...
  66.  *
  67.  * Pairs themselves can be read off either row-wise or column-wise as above.
  68.  *
  69.  */
  70.  
  71. enum graph_pair_orientation 
  72. {
  73.   graph_hz = 0,
  74.   graph_vt = 1,
  75.   graph_implicit = 2,
  76.   graph_num_pair_orientations = 3
  77. };
  78.  
  79. extern int graph_ornt_row_magic [graph_num_pair_orientations];
  80. extern int graph_ornt_col_magic [graph_num_pair_orientations];
  81.  
  82. #define PAIR_ORDER(ORDER,ORNT)  \
  83.   (((ORDER) * graph_num_pair_orientations) + ORNT)
  84.  
  85. #define ORDER_OF_PAIRS(GPO) ((GPO) / graph_num_pair_orientations)
  86.  
  87. enum graph_pair_ordering 
  88. {
  89.   graph_rows_hz = PAIR_ORDER(graph_rows, graph_hz),
  90.   graph_rows_vt = PAIR_ORDER(graph_rows, graph_vt),
  91.   graph_rows_implicit = PAIR_ORDER(graph_rows, graph_implicit),
  92.   graph_cols_hz = PAIR_ORDER(graph_cols, graph_hz),
  93.   graph_cols_vt = PAIR_ORDER(graph_cols, graph_vt),
  94.   graph_cols_implicit = PAIR_ORDER(graph_cols, graph_implicit),
  95.   graph_num_pair_orders = graph_cols_implicit + 1
  96. };
  97.  
  98. extern char *pair_order_name [graph_num_pair_orders];
  99.  
  100.  
  101. #ifdef __STDC__
  102. typedef void (*fpi_thunk) (void * rock, CELL * cp, CELLREF, CELLREF);
  103. #else
  104. typedef void (*fpi_thunk) ();
  105. #endif
  106.  
  107.  
  108.  
  109. #ifdef __STDC__
  110. extern enum graph_axis chr_to_axis (int c);
  111. extern enum graph_ordering chr_to_graph_ordering (int c);
  112. extern enum graph_pair_ordering chrs_to_graph_pair_ordering (int pair, int dir);
  113. extern char * graph_quoted_str (char *str);
  114. extern void graph_x11_mono (void);
  115. extern void graph_x11_color (void);
  116. extern void graph_postscript (char * file, int kind, int spectrum, char * font, int pt_size);
  117. extern void graph_set_axis_title (int axis_c, char * title);
  118. extern void graph_set_logness (int axis_c, int explicit, int newval);
  119. extern void graph_check_range (char * val);
  120. extern void graph_set_axis_lo (int axis_c, char * val);
  121. extern void graph_set_axis_hi (int axis_c, char * val);
  122. extern void graph_set_axis_symbolic (int axis_c, struct rng * rng, int ordering_c) ;
  123. extern void graph_set_axis_labels (int axis_c, struct rng * rng, int pair, int dir);
  124. extern void graph_default_axis_labels (int axis_c);
  125. extern int graph_check_style (char * name);
  126. extern void graph_set_style (int data_set, char * style);
  127. extern void graph_set_data_title (int data_set, char * title);
  128. extern void graph_set_data (int data_set, struct rng * rng, int pair, int dir);
  129. extern void graph_presets (void);
  130. extern void graph_clear_datasets (void);
  131. extern void init_graphing (void);
  132. extern void graph_make_info (void);
  133. extern void for_pairs_in (struct rng * rng, enum graph_pair_ordering order, fpi_thunk thunk, void * frame);
  134. extern void graph_plot (void);
  135.  
  136. #else
  137. extern enum graph_axis chr_to_axis ();
  138. extern enum graph_ordering chr_to_graph_ordering ();
  139. extern enum graph_pair_ordering chrs_to_graph_pair_ordering ();
  140. extern char * graph_quoted_str ();
  141. extern void graph_x11_mono ();
  142. extern void graph_x11_color ();
  143. extern void graph_postscript ();
  144. extern void graph_set_axis_title ();
  145. extern void graph_set_logness ();
  146. extern void graph_check_range ();
  147. extern void graph_set_axis_lo ();
  148. extern void graph_set_axis_hi ();
  149. extern void graph_set_axis_symbolic ();
  150. extern void graph_set_axis_labels ();
  151. extern void graph_default_axis_labels ();
  152. extern int graph_check_style ();
  153. extern void graph_set_style ();
  154. extern void graph_set_data_title ();
  155. extern void graph_set_data ();
  156. extern void graph_presets ();
  157. extern void graph_clear_datasets ();
  158. extern void init_graphing ();
  159. extern void graph_make_info ();
  160. extern void for_pairs_in ();
  161. extern void graph_plot ();
  162.  
  163. #endif
  164.  
  165. #endif  /* GRAPHH */
  166.  
  167.  
  168.